<!--  -->
<template>
    <div>
        <van-field rows="1" autosize type="textarea" v-model="fromdata.name" label-width="6.5em" readonly label="支部学习要点:"
            placeholder="请填写支部学习要点" />
        <van-field rows="1" autosize type="textarea" v-model="fromdata.createdTime" label-width="4.5em" readonly
            label="发布时间:" placeholder="" />
        <van-field label-width="10em" readonly required label="附件:" class="lyy-width" input-align="left" placeholder="">
        </van-field>
        <div v-for="(fileitem) in fromdata.formFiles" :key="fileitem.id" style="margin-left:20px">
            <div readonly class="font14 fileLink" style="color:#0F85CF">
                <a target="_blank" @click="openFileUrlfun(item.anonymousFilePath)">{{ fileitem.fileName }}</a>
                <!-- <a :href='openFileUrlfun(item.anonymousFilePath)'>{{fileitem.fileName}}</a> -->
            </div>
        </div>
    </div>
</template>

<script>
import { getDYYTTZDetail } from '@/api/dwdyytAPI'
import { mapGetters } from "vuex"
import { Notify, Toast } from 'vant'
import { openFileUrl } from '@/store/openFile'
export default {
    data() {
        return {
            fromdata: {},
            params: this.$route.query
        }
    },
    computed: {
        ...mapGetters(['user'])
    },
    //生命周期--创建完成
    created() {
        this.getdetail();
    },
    //生命周期--挂载完成 
    mounted() {

    },
    //方法调用
    methods: {
        openFileUrlfun(value) {
            this.$router.push(
                {
                    name: 'fileview',
                    query: {
                        openFileUrl: openFileUrl(value)
                    }
                }
            );
        },

        getdetail() {
            Toast.loading({
                message: '加载中',
                forbidClick: false
            });

            getDYYTTZDetail(Object.assign(this.params, { userName: this.user.userName }))
                .then((result) => {
                    this.fromdetal = {};
                    Toast.clear();
                    if (!result.data) {
                        Notify(result.message);
                        return;
                    }

                    if (result.data.data) {
                        this.fromdata = result.data.data;
                        if (!result.data.data.formFiles) {
                            this.fromdata.formFiles = [];
                        }
                    }
                })
        }
    }
}
</script>

<style  scoped>
/* @import url();*/
</style>